package com.prolificinteractive.materialcalendarview;

import ohos.agp.text.Font;

import org.threeten.bp.DayOfWeek;
import org.threeten.bp.LocalDate;

import java.util.Collection;

/**
 * Display a week of {@linkplain DayView}s and
 * seven {@linkplain WeekDayView}s.
 */
class WeekView extends CalendarPagerView {

    public WeekView(
        final MaterialCalendarView view,
        final CalendarDay firstViewDay,
        final DayOfWeek firstDayOfWeek,
        final boolean showWeekDays,
        final Font font) {
        super(view, firstViewDay, firstDayOfWeek, showWeekDays,font);
    }

    @Override
    protected void buildDayViews(final Collection<DayView> dayViews, final LocalDate calendar) {
        LocalDate temp = calendar;
        for (int i = 0; i < DEFAULT_DAYS_IN_WEEK; i++) {
            addDayView(dayViews, temp);
            temp = temp.plusDays(1);
        }
    }

    @Override
    protected boolean isDayEnabled(CalendarDay day) {
        return true;
    }

    @Override
    protected int getRows() {
        return showWeekDays ? DAY_NAMES_ROW + 1 : 1;
    }
}
